//once
const EventEmitter = require('events');
const eventEmitter = new EventEmitter();
//once指的是只监听一次，一旦触发事件了，就会执行一次回调函数，并移除监听
eventEmitter.once('click',()=>{
    console.log('clicked')
});
eventEmitter.emit('click');
eventEmitter.emit('click');
eventEmitter.emit('click');